﻿<%

Dim conn
Dim rs

Call conn_open()

Sub conn_open()

	'On Error Resume Next

	Dim sql_username,sql_password,sql_databasename,sql_localname

	sql_localname = "localhost\sql2005"
	sql_databasename = "Hainan_Domestic"
	sql_username = "sa"
	sql_password = "hada@1029"


	connstr = "Provider = Sqloledb; User ID = " & sql_username & "; Password = " & sql_password & "; Initial Catalog = " & sql_databasename & "; Data Source = " & sql_localname & ";"

	Set conn = server.CreateObject("ADODB.Connection")
	conn.open connstr

	If Err.Number <> 0 Then
		response.write "数据库连接错误，请与系统管理员联系！"
		response.End 
	End If


	Set rs = Server.CreateObject("ADODB.recordset")
	
End Sub 

Sub conn_close()
	If IsObject(rs) Then Set rs = Nothing
	If IsObject(conn) Then Set conn = Nothing
End Sub

%>
